package com.ruoyi.smartcity.park.controller;

import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.smartcity.park.domain.ParkCheweiinfo;
import com.ruoyi.smartcity.park.service.IParkCheweiinfoService;
import com.ruoyi.smartcity.park.service.IParkJiaofeiinfoService;
import com.ruoyi.smartcity.traffic.vo.EchartsOptionVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author harry
 * @公众号 Harry技术
 */
@RestController
@RequestMapping("/smartcity/park/index")
public class ParkIndexController {

    @Resource
    private IParkCheweiinfoService iParkCheweiinfoService;
    @Resource
    private IParkJiaofeiinfoService iParkJiaofeiinfoService;

    // 停车场车位情况
    @GetMapping("/cheweiIndex")
    public AjaxResult cheweiIndex() {
        Map<String, List<ParkCheweiinfo>>  map=  iParkCheweiinfoService.cheweiIndex();
        return AjaxResult.success(map);
    }

    // 停车场不同区域位置停车位数量统计柱状图
    @GetMapping("/cheweiQy")
    public AjaxResult cheweiQy() {
        EchartsOptionVO list = iParkCheweiinfoService.cheweiQy(new ParkCheweiinfo());
        return AjaxResult.success(list);
    }
    // 停车场车位状态统计饼状图
    @GetMapping("/cheweiStatus")
    public AjaxResult cheweiStatus() {
        List<Map<String, Object>>  list = iParkCheweiinfoService.cheweiStatus();
        return AjaxResult.success(list);
    }

    // 近一周停车场车辆入场数量趋势图
    @GetMapping("/cheweiTrend")
    public AjaxResult cheweiTrend() {
        EchartsOptionVO list = iParkJiaofeiinfoService.cheweiTrend();
        return AjaxResult.success(list);
    }
}
